package Question.person;
import Question.organization.Course;
import java.util.List;
import java.util.ArrayList;

public class Student extends Person{
    private String studentid;
    private int grape;
    private List<Course> selectedCourse=new ArrayList<>();
    public Student(){}
    public Student(String name,int age,String gender,String studentid,int grape){
    super(name, age, gender);
    this.studentid=studentid;
    this.grape=grape;
    }
    public String getStudentid(){
        return studentid;
    }
    public void setStudentid(String studentid){
        this.studentid=studentid;
    }
    public int getGrape(){
        return  grape;
    }
    public void setGrape(int grape){
        this.grape=grape;
    }
    public void selectCourse(Course course){
        selectedCourse.add(course);
        System.out.println(getName()+"选了"+course.getCousename()+"老师"+course.getTeacher().getName());
    }
    public void showselectedCourse(){
        System.out.println(getName()+"已选课程:");
        for (Course course:selectedCourse){
            System.out.println(course.getCousename()+"授课老师"+course.getTeacher().getName());
        }
    }
}
